﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using BaseData.Common;

namespace SnGeneral
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnCreate_Click(object sender, EventArgs e)
        {
            string cpu = this.txtCNo.Text.Trim();
            string mac = this.txtMNo.Text.Trim();
            string encyKey = cpu + "shizi" + mac + "sunllly@139.com";
            HashEncrypt ecy = new HashEncrypt(HashEncrypt.ServiceProviderEnum.MD5);
            string sn = ecy.HashString(encyKey);
            sn = ecy.HashString(DateTime.Now.ToString()) + ecy.HashString(System.Guid.NewGuid().ToString())
                + "HUIHUIGFDF" + sn + "0E0BYANYAN" + ecy.HashString(System.Guid.NewGuid().ToString());
            this.txtSn.Text = sn;
            this.panel2.Visible = true;
            this.panel1.Visible = false;
        }

        private void btnRetry_Click(object sender, EventArgs e)
        {
            this.panel1.Visible = true;
            this.panel2.Visible = false;
        }
    }
}
